// const mysql = require('mysql');
// const conn = mysql.createConnection({
//   host:"127.0.0.1",
//   user:"root",
//   password:"root",
//   database:"test"
// });
// conn.connect();
// module.exports = conn;

//1.加载mysql模块
const mysql = require('mysql');
//2.创建服务器链接对象
const conn = mysql.createConnection({
  host:"127.0.0.1",
  user:"root",
  password:"root",
  database:"test",
  port:3306
});
//3.链接服务器
conn.connect();
//4.导出链接对象
module.exports = conn;
